<div class="bg-light lter b-b wrapper-md">
    <h4 class="m-n font-thin">当前账号管理</h4>
    <button ui-sref="app.home" class="btn-back btn btn-dark btn-sm btn-rounded">
        返回
    </button>
</div>
<div class="wrapper-md ng-scope" ng-controller="editInternalNowAccountCtrl">

    <div class="panel panel-default">
        <div class="panel-heading font-bold">
            修改当前账号信息
        </div>
        <div class="panel-body">
            <form name="systemUserForm" class="form-horizontal form-validation" method="post">
                <div class="form-group">
                    <label class="col-sm-2 control-label">账号/手机</label>
                    <div class="col-sm-5">
                        <div class="input-group">
                            <span class="input-group-btn">
                                <button class="btn btn-default" type="button">+86</button>
                            </span>
                            <input name="mobilePhone" ng-model="systemUser.mobilePhone" ng-change="isUpdateMobilePhone=1" type="text" class="form-control"  ng-pattern="/^1[34578]\d{9}$/" required ng-readonly="isUpdateMobilePhone == 0">
                        </div>
                        <div class="m-t-xs" ng-if="systemUserForm.mobilePhone.$touched">
                            <span class="text-danger h6" ng-if="systemUserForm.mobilePhone.$error.required">手机号码不允许为空</span>
                            <span class="text-danger h6" ng-if="systemUserForm.mobilePhone.$error.pattern">请输入正确的手机号码</span>
                        </div>
                    </div>
                    <div class=" m-t-sm col-sm-5 form-text" ng-show="isUpdateMobilePhone == 0">
                        <a  ng-click="isUpdateMobilePhone = 1" class="text-info h5">修改手机</a>
                    </div>
                </div>

                <div class="form-group" ng-if="isUpdateMobilePhone == 1">
                    <label class="col-sm-2 control-label">手机验证码</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" placeholder="请输入正确的手机号验证码" name="code"  ng-model="systemUser.newPhoneCode" required>
                        <div ng-if="systemUserForm.code.$touched">
                            <label class="pull-left text-left text-danger h6 l-h"  ng-if="systemUserForm.code.$error.required">验证码为必填项</label>
                            <label class="pull-left text-left text-danger h6 l-h"  ng-if="status==647">验证码有误,请重新输入</label>
                            <label class="pull-left text-left text-danger h6 l-h"  ng-if="status==408">验证码已过期,请重新获取</label>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="btn btn-success" ng-click="check()" ng-bind="description" ng-disabled="canClick"></div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">新密码</label>
                    <div class="col-sm-5">
                        <input type="password" class="form-control" name="password" maxlength="16" ng-model="systemUser.password" ng-minlength="6" ng-maxlength="16" ng-readonly="systemUser.isUpdatePassword == 0" >
                        <div ng-if="systemUserForm.password.$touched">
                            <label class="pull-left text-left text-danger h6 l-h"  ng-if="systemUserForm.password.$error.required">密码为必填项</label>
                            <label class="pull-left text-left text-danger h6 l-h"  ng-if="systemUserForm.password.$error.minlength || systemUserForm.password.$error.maxlength">密码长度最少为6位数,最长为16位数</label>
                        </div>
                    </div>
                    <div class=" m-t-sm col-sm-5 form-text"  ng-if="systemUser.isUpdatePassword == 0">
                        <a  ng-click="systemUser.isUpdatePassword = 1" class="text-info h5">修改密码</a>
                    </div>
                </div>
                <div class="form-group" ng-if="systemUser.isUpdatePassword == 1">
                    <label class="col-sm-2 control-label">确认密码</label>
                    <div class="col-sm-5">
                        <input type="password" class="form-control" name="confirmPassword" maxlength="16" ng-model="systemUser.confirmPassword" required>
                        <div ng-if="systemUserForm.confirmPassword.$touched">
                            <label class="pull-left text-left text-danger h6 l-h"  ng-if="systemUserForm.confirmPassword.$error.required">确认密码为必填项</label>
                            <label class="pull-left text-left text-danger h6 l-h"  ng-if="!systemUserForm.confirmPassword.$error.required && systemUser.confirmPassword != systemUser.password">密码与确认密码不一致</label>
                        </div>
                    </div>
                    <div class="col-sm-5 form-text">
                        <span class="text-muted h6">*请再次输入密码</span>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">姓名</label>
                    <div class="col-sm-5">
                        <input ng-model="systemUser.name" type="text" class="form-control" required>
                    </div>
                    <div class="col-sm-5 form-text">
                        <span class="text-muted h6">*姓名是必填的</span>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">性别</label>
                    <div class="col-sm-5">
                        <div class="radio">
                            <label class="i-checks i-checks-sm">
                                <input type="radio" name="gender" ng-model="systemUser.gender" ng-value=1>
                                <i></i>
                                男
                            </label>
                            <label class="i-checks i-checks-sm">
                                <input type="radio" name="gender" ng-model="systemUser.gender" ng-value=0>
                                <i></i>
                                女
                            </label>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">Email</label>
                    <div class="col-sm-5">
                        <input name="email" ng-model="systemUser.email" type="email" class="form-control" required>
                        <div class="m-t-xs" ng-if="systemUserForm.email.$touched">
                            <span class="text-danger h6" ng-if="systemUserForm.email.$error.required">邮箱不允许为空</span>
                            <span class="text-danger h6" ng-if="systemUserForm.email.$error.email">请输入正确的邮箱号码</span>
                            <span class="text-danger h6" ng-if="systemUserForm.email.$error.pattern">请输入正确的邮箱号码</span>
                        </div>
                    </div>
                    <div class="col-sm-5 form-text">
                        <span class="text-muted h6">*用于找回密码，接受认证信息等</span>
                    </div>
                </div>

                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <div class="col-sm-4 col-sm-offset-2">
                        <button type="submit" class="btn btn-success" ng-disabled="systemUserForm.$invalid || systemUser.confirmPassword != systemUser.password" ng-click = "openUpdate()">保存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>